package com.trainfinder;

import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.trainfinder.ripper.sweep.ShortSweep;
import com.trainfinder.ripper.sweep.Sweep;
import com.trainfinder.ripper.sweep.SweepScheduler;

public class ShortScan extends Action {

	public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(
			"EEEE, d MMM yyyy");

	private final static SweepScheduler SCHEDUALER = new SweepScheduler();

	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {

		Sweep sweep = new ShortSweep();
		                                      
		SCHEDUALER.process(sweep, "london", "brussels");	
		SCHEDUALER.process(sweep, "london", "lille");
		SCHEDUALER.process(sweep, "london", "paris");

	
		return (mapping.findForward("success"));

	}
	
	public static void main(String args[]) {
		Sweep sweep = new ShortSweep();
	 	SCHEDUALER.process(sweep, "london", "lille");		
		SCHEDUALER.process(sweep, "london", "brussels");	
		SCHEDUALER.process(sweep, "london", "paris")	;
	}
}